﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using UIFramework;

namespace FieldServices
{
    public partial class frmResourceList : UIForm
    {
        public frmResourceList()
        {
            InitializeComponent();
        }
        private string _OrderID;
        public frmResourceList(string Order)
        {
            this._OrderID = Order;
            InitializeComponent();
        }
        private DataTable dt;
        private void DisplayResourceList(string OrderID)
        {
          
    //        <MATERIAL>400022</MATERIAL>
    //<MATL_DESC>RUA5_U32B_VIBRATION ABSORBER</MATL_DESC>
    //<ACTIVITY>10</ACTIVITY>
    //<PRICE>80</PRICE>
    //<PRICE_UNIT>1</PRICE_UNIT>
    //<ENTRY_QUANTITY>0</ENTRY_QUANTITY>
    //<CURRENCY>KWD</CURRENCY >
    //<BASE_UOM></BASE_UOM>
    //<PERSNO>34</PERSNO>
    //<ORDERID>2000000020</ORDERID>

            lblOrder.Text = OrderID;
            DataTable _dt = new DataTable();
            //_dt.Columns.Add("MATERIAL", typeof(string));
            _dt.Columns.Add("ITEMLIST", typeof(string));
            //_dt.Columns.Add("MATL_DESC", typeof(string));
            _dt.Columns.Add("PRICE", typeof(string));
            _dt.Columns.Add("ENTRY_QUANTITY", typeof(string));
            DataGridTextBoxColumn ColOrder = new DataGridTextBoxColumn();
            ColOrder.MappingName = "ITEMLIST";
            ColOrder.HeaderText = "Item list";
            ColOrder.Width = 120;
            ColOrder.Format = "c";

            DataGridTextBoxColumn ColCustomer = new DataGridTextBoxColumn();
            ColCustomer.MappingName = "PRICE";
            ColCustomer.HeaderText = "Stock";
            ColCustomer.Width = 260;
            ColCustomer.Format = "c";

            DataGridTextBoxColumn ColStatus = new DataGridTextBoxColumn();
            ColStatus.MappingName = "ENTRY_QUANTITY";
            ColStatus.HeaderText = "Van";
            ColStatus.Width = 80;
            ColStatus.Format = "c";

            //DataSet ds = Common.dsItems;
            //dt = ds.Tables[2];
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{

            //    DataRow dr = _dt.NewRow();
            //    dr[0] = dt.Rows[i]["ACTIVITY"].ToString();
            //    dr[1] = dt.Rows[i]["START_CONS"].ToString();
            //    dr[2] = dt.Rows[i]["DESCRIPTION"].ToString();
            //    _dt.Rows.Add(dr);

            //}
            //DataGridTableStyle aGridTableStyle = new DataGridTableStyle();
            //aGridTableStyle.GridColumnStyles.Add(ColOrder);
            //aGridTableStyle.GridColumnStyles.Add(ColCustomer);
            //aGridTableStyle.GridColumnStyles.Add(ColStatus);
            //_dt.TableName = "OperationItems";
            //dtgOperation.DataSource = _dt;
            //dtgOperation.TableStyles.Add(aGridTableStyle);
            //aGridTableStyle.MappingName = "OperationItems";
        }
    }
}